package com.tonghe05.dao;

import com.tonghe05.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Date:2021/12/22- 12- 22- 17:57
 **/
public interface UserMapper {
    @Select("select * from logintable1")
    List<User> getUserList();

    @Select("select * from logintable1 where id = #{id}")
    User getUserById(@Param("id") int x);

    @Delete("delete * from logintable1 where id = #{id}")
    int deleteUserById(@Param("id")int x);

    @Update("update logintable1 set pwd=#{pwd} where id = #{id}")
    int updateUserById(@Param("id")int x,@Param("pwd")String password);

    @Insert("insert into logintable1(id,name,pwd) values(#{id},#{name},#{pwd})")
    int addUser(User user);
}
